package ldh.common.testui.handle.impl;

import de.jensd.fx.glyphs.fontawesome.FontAwesomeIcon;
import de.jensd.fx.glyphs.fontawesome.FontAwesomeIconView;
import javafx.scene.Parent;
import javafx.scene.control.*;
import ldh.common.testui.constant.TreeNodeType;
import ldh.common.testui.handle.BaseTreeNodeService;
import ldh.common.testui.model.TreeNode;
import ldh.common.testui.util.RegionUtil;

import java.util.ArrayList;
import java.util.List;

public class SqlTreeNodeService extends BaseTreeNodeService {

    public SqlTreeNodeService(TreeView<TreeNode> treeView, TabPane tabPane, ContextMenu contextMenu, TreeNodeType treeNodeType) {
        super(treeView, tabPane, contextMenu, treeNodeType);
    }

    @Override
    protected void mouseClicked(TreeItem<TreeNode> treeItem) {
        if (treeItem == null || treeItem.getValue() == null) return;
        if (treeItem.getValue().getTreeNodeType() != treeNodeType) return;
        openTab(treeItem, RegionUtil.sqlCheckPane(treeItem));
    }

    @Override
    public List<MenuItem> buildNodeMenuItem(TreeItem<TreeNode> treeItem) {
        List<MenuItem> result = new ArrayList<>();

        return result;
    }
}
